package com.zcx.qshop.conn;

import org.json.JSONObject;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

@HttpInlet(Conn.INLET_JSON_AVATAR)
public class JsonAvatarAsyPost extends QSAsyPost<JsonAvatarAsyPost.Info> {
	
	public String uid, picurl; 
 
	public JsonAvatarAsyPost(String uid, String picurl, AsyCallBack<Info> asyCallBack) {

		super(asyCallBack);
		
		this.uid = uid;
		
		this.picurl = picurl;
		
 	}
	
	@Override
	public Info parser(JSONObject object) {
		
		if(object.optString("message").equals("1")){
			
			Info info = new Info();
			
			info.picurl = Conn.SERVICE + object.optString("picurl");
			
			return info;
			
		}
		
		return null;
		
	}

	@Override
	protected String fileKey(String fieldName, int position) {



		return super.fileKey(fieldName, position);

	}

	public static class Info{
		
		public String picurl;
		
	}

}
